package com.boot.persistence.service.association;

import com.boot.persistence.mapper.IMapper;
import com.boot.persistence.model.AssociationModel;
import com.boot.persistence.model.BaseModel;
import com.boot.persistence.service.IService;

import java.io.Serializable;
import java.util.Collection;
import java.util.List;

/**
 * @author 霜寒 <1621856595@qq.com>
 * @description 多对多关联查询业务接口
 * @date 2019/11/13 20:27
 **/

public interface IAssociationService<Tid extends Serializable, Mid extends Serializable, Nid extends Serializable,
        T extends AssociationModel<Tid, Mid, Nid>, M extends BaseModel<Mid>, N extends BaseModel<Nid>, Mapper extends IMapper<T>, MMapper, NMapper>
        extends IService<Tid, T, Mapper> {

    Collection<N> m2n(Mid mid);

    Collection<N> m2n(List<Mid> mids);

    Collection<M> n2m(Nid nid);

    Collection<M> n2m(List<Nid> nids);

    MMapper getMMapper();

    NMapper getNMapper();

    T createModel();

    M createMModel();

    N createNModel();

}
